package morphia.spring;

import com.mongodb.MongoOptions;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * {@link com.mongodb.DB}'s properties holder.<br/>
 * Usage:<div style="color:#515151">
 * &nbsp;&nbsp;&nbsp;&nbsp;&#64;DBDef(name = &quot;cloudDB&quot;, host = "host.cloud.com", port = 27847, databaseName = &quot;dbName&quot;, username = &quot;username&quot;, password = &quot;password&quot;)<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;private {@link DbDefinition} dbdef;</div>
 * @author Kent Yeh
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
@Documented
@Inherited
public @interface DBDef {

    /**
     * register name;
     */
    String name() default "";

    String host() default "localhost";

    int port() default 27017;

    /**
     * {@link MongoOptions}'s bean name
     */
    String optionsRef() default "";

    String databaseName();

    String username() default "";

    String password() default "";
}
